<?php

class CategoriasView extends Categorias{
	
	public function listar($arr){
		$total = count($arr);
		for($i = 0;$i < $total;$i++){
				echo '<tr>';
					echo '<td width="5%" style="background-color: rgb(',$arr[$i]['cor'],');">&nbsp;</td>';
					echo '<td width="35%">',$arr[$i]['nome'],'</td>';
					echo '<td width="20%" align="center" onclick="javascript:editar(',$arr[$i]['idcategorias'],',\'categorias\');" class="tabelaB"><img src="images/app-edit-icon.png" width="20" align="absmiddle" /> Editar</td>';
					echo '<td width="20%" id="editar" align="center" onclick="javascript:excluir(',$arr[$i]['idcategorias'],',\'Categorias\');" class="tabelaB"><img src="images/app-delete-icon.png" width="20" align="absmiddle" /> Excluir</td>';
				echo '</tr>';
	    }
	}
	public function visualizar($arr){
		$total = count($arr);
		for($i = 0;$i < $total;$i++){
			echo '<li class="cor_',$arr[$i]['idcategorias'],'" ><span class="bull">&bull;</span><a href="blog.php?c=',$arr[$i]['idcategorias'],'">',$arr[$i]['nome'],'</a></li>';	
		}
	}
	public function select($arr){
		$total = count($arr);
		for($i = 0;$i < $total;$i++){
			echo '<option value="',$arr[$i]['idcategorias'],'">',$arr[$i]['nome'],'</option>';
	    }
	}
	public function bolinhas($arr){
		$total = count($arr);
		$cor = array(0 => '1',1 => '3',2 => '5',3 => '2',4 => '4',5 => '6');
		for($i = 0;$i < $total;$i++){
			echo '<li style="color:rgb(',$arr[$i]['cor'],');" rel="',strtoupper($arr[$i]['nome']),'" opt="',$arr[$i]['idcategorias'],'" >&bull;</li>';
		}
	}
}
?>